<template>
    <div>
        <h1>{{msg}}</h1>
        <button @click="revFn">点我翻转</button>
    </div>
</template>

<script>
export default {
    name: 'VuecliDemoApp',

    data() {
        return {
            msg:'HELLOWORD'
        };
    },

    mounted() {
        
    },

    methods: {
        revFn(){
            /* 现将msg转换成数组,用split()切割然后用reverse()数组方法翻转,然后用join()方法拼接为字符串 */
            /* 链式编程 */
            this.msg=this.msg.split('').reverse().join('')
        }
    },
};
</script>

<style lang="scss" scoped>

</style>